﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Chucnang.ascx.cs" Inherits="UserControl_Role_Chucnang" %>
<%@ Register TagPrefix="ew" Namespace="eWorld.UI" Assembly="eWorld.UI" %>
<table cellspacing="0" cellpadding="2" style="width:100%;" class="cssTable" border="0">
	<tr>
		<td class="cssPageTitleBG" colspan="6">
		    <asp:label id="lblUser" runat="server" CssClass="cssPageTitle" Text="Quản lý chức năng người dùng"/>
		</td>
	</tr>
	<tr>
		<td colspan="6">
		    <asp:validationsummary id="vdsCategory" runat="server" CssClass="cssManField" Font-Bold="true" />
		   <asp:label id="lblMess" runat="server" CssClass="cssManField" />
		</td>
	</tr>
	<tr>
		<td align="right" style="width:15%;">
			<asp:label id="lblFullName" CssClass="cssManField" runat="server" Text="<U>T</U>ên chức năng:" />
		</td>
		<td style="width:30%;">
			<asp:textbox id="txtTenChucNang" accessKey="e" CssClass="cssTextBox"  runat="server" MaxLength="64" Width="96%" />
		</td>
		<td style="width:5%;">
            <asp:CustomValidator ID="ctvTenChucNang" runat="server" ControlToValidate="txtTenChucNang" ErrorMessage="Bạn phải nhập Tên Chức Năng" Display="Static" Text="*" />
        </td>
		<td align="right" style="width:15%;">
		    <asp:label id="lblQuestion" runat="server" CssClass="cssManField" Text="<U>T</U>ên Form:" />
		</td>
		<td align="left" style="width:30%;">
		    <asp:textbox id="txtTenForm" accessKey="t" runat="server" CssClass="cssTextBox"  Width="96%" MaxLength="32" />
		</td>
		<td style="width:5%;">
		    <asp:CustomValidator ID="ctvTenForm" runat="server" ControlToValidate="txtTenForm" ErrorMessage="Bạn phải nhập Tên Form" Display="Static" Text="*" />   
		 </td>
	</tr>
	<tr>
		<td align="right" >
		    <asp:label id="lblViTri" runat="server" CssClass="cssManField" Text="<U>V</U>ị trí:" />
		</td>
		<td align="left">
		    <asp:DropDownList id="ddlViTri" accessKey="m" runat="server"   Width="40%" />
		</td>
		<td >
			
		</td>
		<td align="right">
		    <asp:label id="Label1" runat="server" CssClass="cssManField" Text="<U>T</U>rạng thái:" />
		</td>
		<td align="left">
		    <asp:CheckBox ID="cbTrangThai" runat="server" Enabled="false" />
		</td>
		<td>
		    
		</td>
	</tr>
	<tr>
		<td align="right">
			<asp:label id="Label4" CssClass="cssManField" runat="server" Text="<U>C</U>hức năng cha:"/>
		</td>
		<td valign="top" >
		    <asp:DropDownList id="ddlChucNangCha" runat="server" Width="98%" 
                AutoPostBack="true" 
                onselectedindexchanged="ddlChucNangCha_SelectedIndexChanged" />
	    </td>
        <td></td>
        <td align="right" >
			<asp:label id="Label3" CssClass="cssManField" runat="server" Text="<U>H</U>iển thị:"/>
		</td>
        <td>
            <asp:CheckBox ID="cbHienThi" runat="server" Enabled="false" />
        </td>
	</tr>
    <tr>
        <td></td>
    </tr>	
	<tr>
		<td colspan="5" align="center">
			<asp:button id="btnInsert" accessKey="c" CssClass="cssButton" runat="server"  Width="98px" Text="Tạo mới(c)" OnClick="btnInsert_Click" />&nbsp;
			<asp:button id="btnUpdate" accessKey="c" CssClass="cssButton" runat="server" Width="98px" Text="Sửa(s)" OnClick="btnUpdate_Click" />&nbsp;
			<asp:button id="btnCancel" accessKey="r" CssClass="cssButton" runat="server" Width="98px" Text="Xóa trắng(r)" OnClick="btnCancel_Click" />
		</td>
	</tr>
	<tr>
		<td align="center" colspan="6" style="height:450px;" valign="top">
		    <asp:GridView id="grvChucNang" runat="server" Width="100%" CellPadding="0" CellSpacing="0" 
		        AutoGenerateColumns="False" AllowPaging="true" EmptyDataText="Không tìm thấy chức năng con nào"
                EmptyDataRowStyle-ForeColor="Blue" EmptyDataRowStyle-HorizontalAlign="Center"
                HeaderStyle-CssClass="cssGridHeader" EditRowStyle-CssClass="cssGridEdit" RowStyle-CssClass="cssGridCell" 
		        AlternatingRowStyle-CssClass="cssGridAlterCell" 
                PagerStyle-CssClass="cssGridPager" SelectedRowStyle-CssClass="cssSelectedRow"
				OnRowDataBound="grvChucNang_RowDataBound" OnRowDeleting="grvChucNang_RowDeleting" OnRowEditing="grvChucNang_RowEditing"
				DataKeyNames="ID" PageSize="15" onpageindexchanging="grvChucNang_PageIndexChanging" 
                 >				
                <RowStyle CssClass="cssGridCell"></RowStyle>
                 <PagerSettings Position="TopAndBottom" />
				<Columns>
                    <asp:TemplateField HeaderText="STT"
                                                HeaderStyle-ForeColor="White" ItemStyle-HorizontalAlign="Center">
                                                <HeaderStyle ForeColor="White"></HeaderStyle>
                                                <ItemTemplate><%# Container.DataItemIndex  + 1 %></ItemTemplate>
                                                <ItemStyle HorizontalAlign="Center" Width="4%"></ItemStyle>
                                            </asp:TemplateField>
					<asp:TemplateField Visible="False">
						<ItemTemplate>
							<asp:Label id="lblChucNangID" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.ID") %>' />
						</ItemTemplate>
					</asp:TemplateField>
						
					<asp:TemplateField HeaderText="Tên chức năng" ItemStyle-Width="17%">
						<ItemTemplate>
							<asp:Label id="lblTenChucNang" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.TenChucNang") %>' />
						</ItemTemplate>
                        <ItemStyle Width="17%"></ItemStyle>
					</asp:TemplateField>					
					<asp:TemplateField HeaderText="Tên Form">
						<ItemTemplate>
							<asp:Label id="lblTenForm" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.TenForm") %>' />
						</ItemTemplate>
					</asp:TemplateField>
                    <asp:TemplateField HeaderText="Trạng thái" ItemStyle-HorizontalAlign="Center">
						<ItemTemplate>
							<asp:Label id="lblTrangThai" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.TrangThai") %>' />
						</ItemTemplate>
					</asp:TemplateField>
                    <asp:TemplateField HeaderText="Vị trí" ItemStyle-HorizontalAlign="Center">
						<ItemTemplate>
							<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.ViTri") %>' />
						</ItemTemplate>
					</asp:TemplateField>
                    <asp:TemplateField HeaderText="Chức năng cha" ItemStyle-HorizontalAlign="Center" Visible="false">
						<ItemTemplate>
							<asp:Label id="lblChucNangCha" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.ChucNangParent") %>' />
						</ItemTemplate>
					</asp:TemplateField>
                    <asp:TemplateField HeaderText="Hiển thị" ItemStyle-HorizontalAlign="Center">
						<ItemTemplate>
							<asp:Label id="lblHienThi" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Hienthi") %>' />
						</ItemTemplate>
					</asp:TemplateField>
					<asp:TemplateField HeaderText="Sửa" HeaderStyle-HorizontalAlign="Center">

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

						<ItemStyle HorizontalAlign="Center" Width="7%"></ItemStyle>
						<ItemTemplate>
							<asp:ImageButton id="lbtEdit" runat="server" ImageUrl="~/images/Button/Edit.gif" ToolTip="Sửa mục từ" CommandName="Edit" />
						</ItemTemplate>
					</asp:TemplateField>
					<asp:TemplateField HeaderText="Xóa" HeaderStyle-HorizontalAlign="Center">

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

						<ItemStyle HorizontalAlign="Center" Width="7%"></ItemStyle>
						<ItemTemplate>
							<asp:ImageButton id="lbtDelete" runat="server" ImageUrl="~/images/Button/Delete.gif" ToolTip="Xóa bản ghi" CommandName="Delete" />
						</ItemTemplate>
					</asp:TemplateField>					
				</Columns>

<PagerStyle CssClass="cssGridPager" HorizontalAlign="Center" VerticalAlign="Middle"></PagerStyle>

<SelectedRowStyle CssClass="cssSelectedRow"></SelectedRowStyle>

<HeaderStyle CssClass="cssGridHeader"></HeaderStyle>

<EditRowStyle CssClass="cssGridEdit"></EditRowStyle>

<AlternatingRowStyle CssClass="cssGridAlterCell"></AlternatingRowStyle>
			</asp:GridView></td>
	</tr>	
</table>
<input id="m_i_id" type="hidden" name="m_i_id" runat="server" />